package com.example.demo.project.utils;

public enum Regexp {
	
	ACCOUNT("^[A-z\\d_\\u4e00-\\u9fa5]{3,16}$"),
	EMAIL("\\w+([-+\\.']\\w+)*@\\w+([-\\.]\\w+)*\\.\\w+([-\\.]\\w+)*"),
	// PHONE_NO("^0?(13[0-9]?|15[8-9]?|153|156|18[7-9])[0-9]{8}$|^(\\d{3,4}-)?\\d{3,8}$"); 
	MOBILE("^1\\d{10}$");
	
	private String regExp;
	Regexp(String regExp) {
		this.regExp = regExp;
	}
	
	public boolean validate(String testStr) {
		return testStr.matches(this.regExp);
	}

	public String toString() {
		return (null == regExp) ? super.toString() : regExp;
	}
}
